package com.babel.util.result;

import java.util.List;

/**
 * 分页对象
 * 
 * @author chenhui
 *
 */
public class PageResult<T> {
	private List<T> rows; // 封装响应到客户端的集合
	private Integer total; // 封装数据库的总记录数

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public static <T> PageResult<T> of(List<T> rows,Integer total){
		PageResult<T> pr = new PageResult<T>();
		pr.setRows(rows);
		pr.setTotal(total);
		return pr;
	}


}
